package net.optix.ip.vo
{
	public class CopyrightVO
	{
		public static var CopyTypes:Array	=	
			['Corporation','Individual'];
		
		public var clientID:int;
		public var inventorID:int;
		public var firmID:int;
		public var maxBudget:int;
		public var deadlineDate:String;
		public var bConfirm:int;
		public var sConfirm:String;
		public var copyrightID:int;
		public var practitionerID:int;
		
		public var clientName:String;
		public var firmName:String;
		
		public var title:String;
		public var created:String;
		public var registered:String;
		public var registration:String;
		public var issuedTo:String;
		public var type:int;
		public var typeS:String;
		public var death:String;
		public var expires:String;
		
		public var bBid:int;
		public var requestBidDate:String;
		public var targetDate:String;
		public var budget:int;
		
		public static function purseCopyRight(value:XML):CopyrightVO
		{
			var copy:CopyrightVO	=	new CopyrightVO();
			
			
			try
			{
				copy.title	=	value.Title;
				copy.created	=	value.Created;
				copy.registered	=	value.Registered;
				copy.registration	=	value.Registration;
				copy.issuedTo	=	value.IssuedTo;
				copy.type	=	value.Type;
				copy.death	=	value.Death;
				
				copy.typeS	=	CopyrightVO.CopyTypes[copy.type];
				
				copy.copyrightID=	value.CopyrightID;
				copy.clientID	=	value.ClientID;
				copy.inventorID	=	value.InventorID;
				copy.firmID		=	value.FirmID;
				copy.bConfirm	=	value.BConfirm;
				
				switch(copy.bConfirm)
				{
					case 0:
						copy.sConfirm	=	"NA";
						break;
					case -1:
						copy.sConfirm	=	"Decline";
						break;
					case 1:
						copy.sConfirm	=	"Accept";
						break;
					case 2:
						copy.sConfirm	=	"Returned";
						break;
					case 3:
						copy.sConfirm	=	"";
						break;
				}
				
				copy.deadlineDate=	value.DeadlineDate;
				copy.maxBudget	=	value.MaxBudget;
				copy.practitionerID=value.PractitionerID;
				
				copy.clientName	=	value.ClientName;
				copy.firmName	=	value.FirmName;
				
				copy.expires	=	value.Dxpires;
				
				copy.bBid		=	value.BBid;
				copy.requestBidDate=value.RequestBidDate;
				copy.targetDate	=	value.TargetDate;
				copy.budget		=	value.Budget;
			}
			catch(error:Error){}
			return copy;
		}
	}
}